	
// AdresseType.h : Declaration of the CAdresseType

#ifndef __ADRESSETYPE_H_
#define __ADRESSETYPE_H_

#include "resource.h"       // main symbols

/////////////////////////////////////////////////////////////////////////////
// CAdresseType
class ATL_NO_VTABLE CAdresseType : 
	public CComObjectRootEx<CComMultiThreadModel>,
	public CComCoClass<CAdresseType, &CLSID_AdresseType>,
	public ISupportErrorInfo,
	public IDispatchImpl<IAdresseType, &IID_IAdresseType, &LIBID_EBASDLLLib>
{
public:
	CAdresseType()
	{
		m_pUnkMarshaler = NULL;
		m_type = bstr_t("");
		m_guid = bstr_t("");
	}
	virtual ~CAdresseType()
	{

	}


DECLARE_REGISTRY_RESOURCEID(IDR_ADRESSETYPE)
DECLARE_GET_CONTROLLING_UNKNOWN()

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CAdresseType)
	COM_INTERFACE_ENTRY(IAdresseType)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(ISupportErrorInfo)
	COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
END_COM_MAP()

	HRESULT FinalConstruct()
	{
		return CoCreateFreeThreadedMarshaler(
			GetControllingUnknown(), &m_pUnkMarshaler.p);
	}

	void FinalRelease()
	{
		m_pUnkMarshaler.Release();
	}

	CComPtr<IUnknown> m_pUnkMarshaler;

// ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

// IAdresseType
public:
	STDMETHOD(get_GUID)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(put_GUID)(/*[in]*/ BSTR pVal);
	STDMETHOD(get_AdresseType)(/*[out, retval]*/ BSTR *pVal);
	STDMETHOD(put_AdresseType)(/*[in]*/ BSTR newVal);
private:
	bstr_t m_type, m_guid;
};

#endif //__ADRESSETYPE_H_
